home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Virtual User / Virtual User Current Release / Examples / Example External Tools / MathTool / MathTool.vulib < prev    next >
Encoding:
Text File  |  1998-06-04  |  2.5 KB  |  72 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        MathTool.vulib
  3. #    
  4. #    Written by:    David Gaxiola
  5. #
  6. #    Contents:    MathTool interface.
  7. #
  8. #    Copyright © 1992 Apple Computer, Inc.  All rights reserved.
  9. #
  10. #    Change history:
  11. #        10/30/92    PRT        Add declarations for required tool services.
  12. #                            Make parameters 'undefined' to allow either numbers
  13. #                            or strings.
  14. #        8/11/92        DGG        Created.
  15. #
  16. #    Note:        The TeachText file “MathTool ReadMe” explains the services that MathTool
  17. #                provides, and lists what each service takes as arguments and returns as results.
  18. #                (For the services common to all Virtual User external tools, see the Virtual
  19. #                User Language Reference manual.)  The script file “MathTool Sample.vu"
  20. #                provides a few simple examples in using the MathTool.
  21. #
  22.  
  23. task DefineMathGlobals()
  24. begin
  25.     global gPi := "3.141592654";
  26.     global gE := "2.718281828";
  27. end;
  28.  
  29. tool MathTool s:'VUmt'
  30. begin
  31.  
  32.     # Services specific to MathTool:
  33.     
  34.     Service "fplus"('undefined', 'undefined') return 'String';
  35.     Service "fminus"('undefined', 'undefined') return 'String';
  36.     Service "ftimes"('undefined', 'undefined') return 'String';
  37.     Service "fdivide"('undefined', 'undefined') return 'String';
  38.     Service "fcompare"('undefined', 'undefined') return 'Integer';
  39.  
  40.     Service "sin"('undefined') return 'String';
  41.     Service "cos"('undefined') return 'String';
  42.     Service "tan"('undefined') return 'String';
  43.     Service "asin"('undefined') return 'String';
  44.     Service "acos"('undefined') return 'String';
  45.     Service "atan"('undefined') return 'String';
  46.     Service "sqrt"('undefined') return 'String';
  47.     Service "power"('undefined', 'undefined') return 'String';
  48.     Service "ln"('undefined') return 'String';
  49. #
  50. #   These services work on MC680x0 'LONG' integers.  You can pass them either short integers
  51. #    (ones between -32767 and 32767) or long integers enclosed in quotations.
  52. #
  53.     Service "lplus"('undefined', 'undefined') return 'String';
  54.     Service "lminus"('undefined', 'undefined') return 'String';
  55.     Service "ltimes"('undefined', 'undefined') return 'String';
  56.     Service "ldivide"('undefined', 'undefined') return 'String';
  57.     Service "lcompare"('undefined', 'undefined') return 'Integer';
  58.     Service "lmod"('undefined', 'undefined') return 'String';
  59.     
  60.     
  61.     # Services common to all Virtual User 2.0 external tools:
  62.     
  63.     Service "Initialize"( 'undefined' );        # pass TRUE for target, FALSE for host
  64.     Service "Cancel"( 'string' );
  65.     Service "GetToolServices"() return 'list';
  66.     Service "GetToolVersion"() return 'list';
  67.     Service "Poll"( 'string' ) return 'string';
  68.     Service "ServiceSupported"( 'string' ) return 'undefined';
  69.     Service "Quit"();
  70.  
  71. end;
  72.